<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <style>
      body {
        padding: 0;
        margin: 0;
      }
    </style>
    <div style="height: 2000px; background-color: red; padding: 300px">
      <main
        style="
          height: 300px;
          width: 300px;
          right: 0;
          background-color: yellow;
          position: absolute;
        "
      ></main>
    </div>
    <script>
      //console.log(document.documentElement.offsetHeight);
      //      const main = document.querySelector("main");

      //     let info = main.getBoundingClientRect();

      //    console.log(main.style.right);

      //   document.addEventListener("scroll", function () {
      //        console.log(document.documentElement.clientHeight);
      //       console.log(document.documentElement.scrollTop);
      //  });
    </script>
  </body>
</html>
